/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.mad.bikepony.model.impl;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;

import com.mad.bikepony.model.Delivery;

import java.io.Serializable;

/**
 * The cache model class for representing Delivery in entity cache.
 *
 * @author nicola
 * @see Delivery
 * @generated
 */
public class DeliveryCacheModel implements CacheModel<Delivery>, Serializable {
	@Override
	public String toString() {
		StringBundler sb = new StringBundler(35);

		sb.append("{deliveryId=");
		sb.append(deliveryId);
		sb.append(", deliveryCode=");
		sb.append(deliveryCode);
		sb.append(", trackingCode=");
		sb.append(trackingCode);
		sb.append(", senderAddress=");
		sb.append(senderAddress);
		sb.append(", senderAdditionalInfo=");
		sb.append(senderAdditionalInfo);
		sb.append(", senderEmail=");
		sb.append(senderEmail);
		sb.append(", recipientAddress=");
		sb.append(recipientAddress);
		sb.append(", recipientAdditionalInfo=");
		sb.append(recipientAdditionalInfo);
		sb.append(", recipientEmail=");
		sb.append(recipientEmail);
		sb.append(", state=");
		sb.append(state);
		sb.append(", agentId=");
		sb.append(agentId);
		sb.append(", submissionTimestamp=");
		sb.append(submissionTimestamp);
		sb.append(", pickupTimestamp=");
		sb.append(pickupTimestamp);
		sb.append(", deliveryTimestamp=");
		sb.append(deliveryTimestamp);
		sb.append(", recipientSignature=");
		sb.append(recipientSignature);
		sb.append(", estimatedPickupTime=");
		sb.append(estimatedPickupTime);
		sb.append(", estimatedDeliveryTime=");
		sb.append(estimatedDeliveryTime);
		sb.append("}");

		return sb.toString();
	}

	public Delivery toEntityModel() {
		DeliveryImpl deliveryImpl = new DeliveryImpl();

		deliveryImpl.setDeliveryId(deliveryId);

		if (deliveryCode == null) {
			deliveryImpl.setDeliveryCode(StringPool.BLANK);
		}
		else {
			deliveryImpl.setDeliveryCode(deliveryCode);
		}

		if (trackingCode == null) {
			deliveryImpl.setTrackingCode(StringPool.BLANK);
		}
		else {
			deliveryImpl.setTrackingCode(trackingCode);
		}

		if (senderAddress == null) {
			deliveryImpl.setSenderAddress(StringPool.BLANK);
		}
		else {
			deliveryImpl.setSenderAddress(senderAddress);
		}

		if (senderAdditionalInfo == null) {
			deliveryImpl.setSenderAdditionalInfo(StringPool.BLANK);
		}
		else {
			deliveryImpl.setSenderAdditionalInfo(senderAdditionalInfo);
		}

		if (senderEmail == null) {
			deliveryImpl.setSenderEmail(StringPool.BLANK);
		}
		else {
			deliveryImpl.setSenderEmail(senderEmail);
		}

		if (recipientAddress == null) {
			deliveryImpl.setRecipientAddress(StringPool.BLANK);
		}
		else {
			deliveryImpl.setRecipientAddress(recipientAddress);
		}

		if (recipientAdditionalInfo == null) {
			deliveryImpl.setRecipientAdditionalInfo(StringPool.BLANK);
		}
		else {
			deliveryImpl.setRecipientAdditionalInfo(recipientAdditionalInfo);
		}

		if (recipientEmail == null) {
			deliveryImpl.setRecipientEmail(StringPool.BLANK);
		}
		else {
			deliveryImpl.setRecipientEmail(recipientEmail);
		}

		deliveryImpl.setState(state);
		deliveryImpl.setAgentId(agentId);
		deliveryImpl.setSubmissionTimestamp(submissionTimestamp);
		deliveryImpl.setPickupTimestamp(pickupTimestamp);
		deliveryImpl.setDeliveryTimestamp(deliveryTimestamp);

		if (recipientSignature == null) {
			deliveryImpl.setRecipientSignature(StringPool.BLANK);
		}
		else {
			deliveryImpl.setRecipientSignature(recipientSignature);
		}

		deliveryImpl.setEstimatedPickupTime(estimatedPickupTime);
		deliveryImpl.setEstimatedDeliveryTime(estimatedDeliveryTime);

		deliveryImpl.resetOriginalValues();

		return deliveryImpl;
	}

	public long deliveryId;
	public String deliveryCode;
	public String trackingCode;
	public String senderAddress;
	public String senderAdditionalInfo;
	public String senderEmail;
	public String recipientAddress;
	public String recipientAdditionalInfo;
	public String recipientEmail;
	public int state;
	public long agentId;
	public long submissionTimestamp;
	public long pickupTimestamp;
	public long deliveryTimestamp;
	public String recipientSignature;
	public long estimatedPickupTime;
	public long estimatedDeliveryTime;
}